package com.example.siyun.util;

import java.io.Serializable;
/**
 * @Auther: 全
 * @Date: 2022/10/10 15:17
 * @Description:返回结果的工具类
 */
public class PageResult<E> implements Serializable {
    /* 返回的状态 */
    private Integer state=200;
    /* 返回的条数 */
    private long total;
    /* 返回的信息 */
    private String message="成功";
    /* 返回的数据 */
    private E data;
    /* 返回的响应码 */
//    private Integer code;
    /* 返回的信息 */
//    private String msg;
//    /* 返回的状态 */
//    private Integer status;

    public long getTotal() {
        return total;
    }

//    public Integer getCode() {
//        return code;
//    }
//
//    public void setCode(Integer code) {
//        this.code = code;
//    }

    public long getTotal(long total) {
        return this.total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public PageResult() {
    }

    public PageResult(Integer state) {
        this.state = state;
    }
    public PageResult(Throwable e) {
        this.message = e.getMessage();
    }

    public PageResult(Integer state, String message) {
        this.state = state;
        this.message = message;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public E getData() {
        return data;
    }

    public void setData(E data) {
        this.data = data;
    }

//    public String getMsg() {
//        return msg;
//    }
//
//    public void setMessage(String msg) {
//        this.msg = msg;
//    }

//    public Integer getStatus() {
//        return status;
//    }
//
//    public void setStatus(Integer status) {
//        this.status = status;
//    }
}
